package com.bdqn.t382.sz.Text1;

public class CalculatorSimpleFactory {
    public static Calculator createCalculator(String operator) {
        switch (operator) {
            case "+":
                return new Addition();
            case "-":
                return new Subtraction();
            case "*":
                return new Multiplication();
            case "/":
                return new Division();
            default:
                throw new IllegalArgumentException("不支持的操作符: " + operator);
        }
    }
}

